<template>
	<!-- 根据id 查看医生详情 -->
	<view>
		<view class="container">
			<view class="botsny">
				<image class="logo-img" :src="doctorby.doctorPto"></image>
				<view class="box">
					<view>
						<view class="leftys">{{doctorby.doctorName}}&ensp;&ensp;&ensp;&ensp;&ensp;
							{{doctorby.doctorVariety==0 ?'兽医':'农医'}}
						</view>
						<view class="collect">收藏</view>
					</view>
					<view>
						<view class="yiyuan">{{hospital.hospitalName}}</view>
					</view>
				</view>
			</view>
			
			<view>
				<view class="box">
					<view>
						<view class="wzl">{{doctorby.browse}} &ensp;&ensp; 32min &ensp;&ensp;&ensp; 7.2km</view>
					</view>
					<view>
						<view class="wzl1">问诊量 &ensp;&ensp;&ensp;&ensp;&ensp;&ensp; 平均回复时间 &ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp; 距离</view>
					</view>
				</view>
			</view>

				<view class="fenjie"></view>
			
			<!-- 个人信息 -->
			<view>
				<view class="box">
					<view>
						<view class="wzl2">擅长主治</view>
					</view>
					<view>
						<view class="jibing">{{doctorby.excel}}</view>
					</view>
				</view>
			</view>
			
			<view>
				<view class="box">
					<view>
						<view class="wzl2">个人简介</view>
					</view>
					<view>
						<view class="jibing">{{doctorby.profile}}</view>
					</view>
				</view>
			</view>
			
			<view>
				<view class="box">
					<view>
						<view class="wzl2">出诊地</view>
					</view>
					<view>
						<view class="jibing">{{hospital.hospitalName}} &ensp;&ensp;&ensp;&ensp;|&ensp;&ensp;&ensp;&ensp; {{hospital.hospitalAddress}}</view>
					</view>
				</view>
			</view>
				
				<view class="fenjie"></view>
			
			<!-- 评论 -->
			<view>
				<view class="box">
					<view>
						<view class="wzl2">患者评论(2)</view>
					</view>
				</view>
			</view>
			<view>
				<view class="box">
					<view>
						<view class="wzl2">樱桃小丸子</view>
					</view>
					<view>
						<view class="jibing">李医生回答的很详细，问题一下就解决了，及时控制住病情，非常感谢！</view>
					</view>
				</view>
			</view>

			<view class="box">
					<view>
						<view class="wzl2">匿名******</view>
					</view>
					<view>
						<view class="jibing">医生先生估计太忙了没有回复我的消息</view>
					</view>
			</view>
			
			<view class="box">
				<view>
					<button class="button-yuanjiao">预约挂号</button>
					 <button class="button-yuanjiao" @click="zxzx(list)">在线咨询</button>
					 <button class="button-yuanjiao">电话咨询</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '找医生',
				show:false,
				login: false,
				avatarUrl: "../../static/uni-center/logo.png",
				//医生id
				list:{},
				//单查列表
				doctorby:{},
				hospital:{}
				
			}
		},
		created(){
			
		},
		onLoad:function(option) {
			this.list=option.aaa
			// console.log(this.list)
				uni.request({
					url:'http://localhost:8099/serviceedu/doctor/findById/'+this.list,
					method:'GET',
					success:(res)=>{
						this.doctorby=res.data.data.list
						
						//查询医院
						uni.request({
							url:'http://localhost:8099/serviceedu/hospital/findById/'+this.doctorby.hospitalId,
							method:'GET',
							success:(res)=>{
								console.log(res.data.data.list)
								
								this.hospital=res.data.data.list
							}
						})
						
					}
				})
		},
		methods: {
			zxzx(list){
				// console.log(list)
				uni.reLaunch({
					url: './addpage?aaa=' + list,
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	/* .title {
		font-size: 36rpx;
		color: #8f8f94;
	} */
	.container{
		/* 定义容器 */
		display: flex;
		/* 设置容器排列方向 */
		flex-direction: column;
		height: 100%;
		justify-content: space-around;
		/* background-color: #f0f0f0; */
	}
	.botsny{
		/* background-color: blue; */
		height: 70px;
		
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: flex-start;
		margin-bottom: 10rpx;
	}
	.logo-img {
		width: 130upx;
		height: 130upx;
		border-radius: 200upx;
		left: 50px;
		top: 15px;
	}	
	
	.box{
			/* border:lupx solid #333333; */
			height: 50%;
			width: 70%;
			display: flex;
			flex-direction: column;
			margin-top: 30rpx;
			margin-left: 70rpx;
		}
	.box>view{
		color: #000000;
		font-weight: bold;
		font-size: 30upx;
		flex: 1;
		height: 100upx;
		display: flex;
		/* border: 1upx solid #FFFFFF; */
		align-items: center;
		/* justify-content: center; */
	}
	
	.button-yuanjiao{
		width: 170rpx;
		height: 50rpx;
		display: flex;
		margin-top: 30rpx;
		line-height: 50rpx;
		/* justify-content: center; */
		border-radius: 25px;
		background-color: #8bcbaf;
		font-size: 28rpx;
		color: #ffffff;
		
	}
	
	/* 收藏 */
	.collect{
		width: 120rpx;
		height: 60rpx;
		display: flex;
		margin-top: 30rpx;
		margin-left: 25px;
		line-height: 50rpx;
		justify-content: center;
		border-radius: 25px;
		background-color: #8bcbaf;
		font-size: 30rpx;
		color: #ffffff;
	}
		
	.leftys {
		font-size: 30upx;
		border-radius: 150upx;
		left:100px;
		top:30px;
		margin-left: 40px;
		margin-top: 10px;
		/* position: absolute; */
	}
	.yiyuan{
		font-size: 20upx;
		border-radius: 150upx;
		color: #7e7e7e;
		left:100px;
		top:55px;
		margin-left: 40px;
		margin-top: 8px;
		/* position: absolute; */
	}
	.wzl{
		font-size: 40upx;
		border-radius: 150upx;
		color: #0a7e0a;
		left:100px;
		top:70px;
		margin-left: 20px;
		align-items: center;
		/* position: absolute; */
	}
	.wzl1{
		font-size: 20upx;
		border-radius: 150upx;
		left:100px;
		top:85px;
		align-items: center;
		margin-left: 20px;
		color: #b5b5b5;
		/* position: absolute; */
	}
	
	.wzl2{
		font-size: 20upx;
		border-radius: 150upx;
		left:100px;
		top:85px;
		align-items: center;
		color: #b5b5b5;		
	}
	
	.jibing{
		font-size: 20upx;
		border-radius: 150upx;
		left:100px;
		align-items: center;
		margin-top: 10px;
	}
	
	.zx{
		font-size: 20upx;
		border-radius: 150upx;
		left:150px;
		top:105px;
		/* position: absolute; */
		color: #0a7e0a;
	}
	.fenjie{
		background-color: #d3d3d3;
		height: 5px;
		margin-top: 15px;
	}
	
</style>
